<%--
  Created by IntelliJ IDEA.
  User: 陈俊雄
  Date: 2018/2/24
  Time: 16:23
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<link type="text/css" rel="stylesheet" href="css/common/common.css"/>
<link type="text/css" rel="stylesheet" href="css/tradeRate/tradeRateList.css"/>
<!-- Main view -->
<div class="animated fadeInRight">
    <div class="wrapper wrapper-content ng-scope">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>{{ 'TRANSFER_RATE' | translate }}：</h5>
                    </div>
                    <div class="ibox-content sk-loading" ng-controller="tradeRateInfoCtrl">
                        <div class="sk-spinner sk-spinner-wave">
                            <div class="sk-rect1"></div>
                            <div class="sk-rect2"></div>
                            <div class="sk-rect3"></div>
                            <div class="sk-rect4"></div>
                            <div class="sk-rect5"></div>
                        </div>

                        <form name="myform" serializer="searchTradeRate(data)">
                            <div class="container">
                            <div class="row">
                                  <div class="form-group col-sm-6 col-md-6 col-lg-3">
								    <div for="sourceCurrencyName" class="col-sm-4 control-label data-condition-select-text" >原始币种:</div>
								    <input type="hidden" id="type" name="type" value="2" ng-model="type" /> 
								    <div class="col-sm-8 clear-lr-padding" >
					                   <select id="sourceCurrency" class="form-control data-condition-select" name="sourceCurrency" size="0" ng-model="sourceCurrency" ng-mousedown="selectMouseDown($event)" ng-change="selectSourceCurrencyChange()" ng-blur="selectBlur($event)" >
					                                <option value="String" style="display:none;"></option>
					                                <option value="" ng-modal="sourceCurrencyOption" ng-mouseover="optionMouseOver($event)" ng-click="optionMouseClick($event)" ></option>
	                                                <option ng-repeat="currencyObj in selectCurrencys" value="{{currencyObj.firstValue}}" ng-modal="sourceCurrencyOption_{{item.firstValue}}" ng-mouseover="optionMouseOver($event)" ng-click="optionMouseClick($event)" >
	                                                    {{currencyObj.name}}
	                                                </option>           
					                  </select>
					                </div>
								  </div>
								  
								  <div class="form-group col-sm-6 col-md-6 col-lg-3">
								    <div for="targetCurrencyName" class="col-sm-4 control-label data-condition-select-text" >目标币种:</div>
								    <div class="col-sm-8 clear-lr-padding" >
					                   <select id="targetCurrency" class="form-control data-condition-select" name="targetCurrency" size="0" ng-model="targetCurrency" ng-mousedown="selectMouseDown($event)" ng-change="selectTargetCurrencyChange()" ng-blur="selectBlur($event)" >
					                                <option value="String" style="display:none;"></option>
					                                <option value="" ng-modal="targetCurrencyOption" ng-mouseover="optionMouseOver($event)" ng-click="optionMouseClick($event)" ></option>
	                                                <option ng-repeat="currencyObj in selectCurrencys" value="{{currencyObj.firstValue}}" ng-modal="targetCurrencyOption_{{item.firstValue}}" ng-mouseover="optionMouseOver($event)" ng-click="optionMouseClick($event)" >
	                                                    {{currencyObj.name}}
	                                                </option>           
					                  </select>
					                </div>
								  </div>
                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">创建人：</span>
                                            <input type="text" id="creator" name="creator" value=""
                                                   class="form-control">
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">最后修改人：</span>
                                            <input type="text" id="modifier" name="modifier" value=""
                                                   class="form-control">
                                        </div>
                                    </div>
                                </div>
                                </div>
                                <div class="row">
                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">创建起始日期：</span>
                                            <input type="text" id="minCreateTime" name="minCreateTime"
                                                   uib-tooltip="可只选择创建起始日期查询起始日期至今订单"
                                                   class="form-control" ng-readonly="true" ng-click="openDatepicker1()"
                                                   uib-datepicker-popup="{{format}}" ng-model="minCreateTime"
                                                   is-open="popup1.opend"
                                                   datepicker-options="dateOptions1"
                                                   close-text="关闭" alt-input-formats="altInputFormats"
                                                   close-text="关闭" clear-text="清空" current-text="今天">
                                            <span class="input-group-btn">
                                            <button type="button" class="btn btn-default btn-sm no-margins"
                                                    ng-click="openDatepicker1()">
                                                <i class="fa fa-calendar"></i>
                                            </button>
                                        </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">创建结束日期：</span>
                                            <input type="text" id="maxCreateTime" name="maxCreateTime"
                                                   class="form-control" ng-readonly="true" ng-click="openDatepicker2()"
                                                   uib-datepicker-popup="{{format}}" ng-model="maxCreateTime"
                                                   is-open="popup2.opend"
                                                   datepicker-options="dateOptions2"
                                                   close-text="关闭" alt-input-formats="altInputFormats"
                                                   ng-disabled="maxCreateTimeDisable"
                                                   close-text="关闭" clear-text="清空" current-text="今天">
                                            <span class="input-group-btn">
                                            <button type="button" class="btn btn-default btn-sm no-margins"
                                                    ng-click="openDatepicker2()"
                                                    ng-disabled="maxCreateTimeDisable">
                                                <i class="fa fa-calendar"></i>
                                            </button>
                                        </span>
                                        </div>
                                    </div>
                                 </div>
                                 <div class="col-sm-6 col-md-6 col-lg-3">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">修改起始日期：</span>
                                            <input type="text" id="minModifyTime" name="minModifyTime"
                                                   uib-tooltip="可只选择修改起始日期查询起始日期至今订单"
                                                   class="form-control" ng-readonly="true" ng-click="openDatepicker3()"
                                                   uib-datepicker-popup="{{format}}" ng-model="minModifyTime"
                                                   is-open="popup3.opend"
                                                   datepicker-options="dateOptions3"
                                                   close-text="关闭" alt-input-formats="altInputFormats"
                                                   close-text="关闭" clear-text="清空" current-text="今天">
                                            <span class="input-group-btn">
	                                            <button type="button" class="btn btn-default btn-sm no-margins"
	                                                    ng-click="openDatepicker3()">
	                                                <i class="fa fa-calendar"></i>
	                                            </button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">修改结束日期：</span>
                                            <input type="text" id="maxModifyTime" name="maxModifyTime"
                                                   class="form-control" ng-readonly="true" ng-click="openDatepicker4()"
                                                   uib-datepicker-popup="{{format}}" ng-model="endDate"
                                                   is-open="popup4.opend"
                                                   datepicker-options="dateOptions4"
                                                   close-text="关闭" alt-input-formats="altInputFormats"
                                                   ng-disabled="maxModifyTimeDisable"
                                                   close-text="关闭" clear-text="清空" current-text="今天">
                                            <span class="input-group-btn">
                                            <button type="button" class="btn btn-default btn-sm no-margins"
                                                    ng-click="openDatepicker4()"
                                                    ng-disabled="maxModifyTimeDisable">
                                                   <i class="fa fa-calendar"></i>
                                            </button>
                                        </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-6 col-md-6 col-lg-3 col-lg-offset-3">
                                    <button type="submit" class="btn btn-sm btn-w-m btn-primary pull-right">
                                                                                                                                 查询
                                    </button>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <button type="button" class="btn btn-sm btn-w-m btn-info"
                                            ng-click="resetForm()">
                                                                                                                                 重置
                                    </button>
                                </div>
                                <div class="pull-right col-sm-6 col-md-6 col-lg-3">
                                    <button type="button" class="pull-right btn btn-sm btn-sm btn-success export-btn"
                                            ng-click="exportCsv()">
                                        <i class="fa fa-download"></i>&nbsp;导出数据
                                    </button>
                                </div>
                            </div>
                        </form>
                        <div class="hr-line-dashed"></div>
                        <%-- ng_table --%>
                        <button class="btn btn-sm btn-primary add-btn" ng-click="showAddModal()">新增</button>
                        <div class="table-responsive">
                            <table ng-table="tradeRateTable"
                                   class="table table-condensed table-striped table-hover table-bordered">
                                <tr ng-repeat="row in $data">
                                    <td class="text-center"
                                        data-title="''">
                                        <input type="checkbox" id="constantCheckBoxID" ng-model="tradeRateCheckBox" ng-click="collectSelectRows($event,row.id)" />
                                    </td>
                                    <td class="text-center" data-title="'原始币种'">
                                        {{row.sourceCurrency | getValueByList : selectCurrencys : 'firstValue' : 'name'}}
                                    </td>
                                    <td class="text-center" data-title="'目标币种'">
                                        {{row.targetCurrency | getValueByList : selectCurrencys : 'firstValue' : 'name'}}
                                    </td>
                                    <td class="text-center" data-title="'汇率'">
                                        {{row.rate}}
                                    </td>
                                    <td class="text-center" data-title="'类型'">
                                        {{row.type | enumParamsFilter:[{2:"划款"}]}}
                                    </td>
                                    <td class="text-center" data-title="'创建人'">
                                        {{row.creator}}
                                    </td>
                                    <td class="text-center" data-title="'创建时间'">
                                        {{row.createTime | date:'yyyy/MM/dd hh:mm:ss'}}
                                    </td>
                                    <td class="text-center" data-title="'修改人'">
                                        {{row.modifier}}
                                    </td>
                                    <td class="text-center" data-title="'修改时间'">
                                        {{row.modifyTime| date:'yyyy/MM/dd hh:mm:ss'}}
                                    </td>
                                    <td class="text-center p-6" data-title="'操作'">
                                        <trade_rate></trade_rate>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <my-pagination table-param="tradeRateTable"></my-pagination>
                        <button class="btn btn-sm btn-primary marginTop-minus del-btn" ng-click="batchDel()" ng-disabled="delDisabled" >删除</button> 
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>